package com.oneday.nuo.base.response;

/**
 *
 * 错误状态
 *@author liushuai
 *@date 2019/11/3 19:54
 */
public enum  NuoErrorStatus {
    LOGIN_ERROR(-200, "访问失败,权限不足"),
    PARAM_IS_NOT_NULL(-300,"参数不能为空"),
    PARAM_ERROR(-400,"参数错误"),
    TOKEN_ERROR(-600,"token认证失败")
    ;





    private int value;
    private String message;

    NuoErrorStatus(int value, String message){
        this.value = value;
        this.message = message;
    }

    NuoErrorStatus( String message){
        this.value = -200;
        this.message = message;
    }




    public int getValue() {
        return value;
    }

    public String getMessage() {
        return message;
    }

    @Override
    public String toString() {
        return "{" +
                "\"value\":" + value +
                ",\"message\":\"" + message + "\"" +
                "}";
    }

    public static String custom(String param){
        return "{" +
                "\"value\":" + -500 +
                ",\"message\":\"" + param + "\"" +
                "}";
    }
}
